#include<iostream>
using namespace std;
int main(){
    int n;
    int a;
	int bb;
    int maxs,mins;
    maxs=999;
    mins=-1;
	cin>>n;
    for(int i=0;i<n;i++) {
        cin >> a >> bb;
        if (min < (a / (bb + 1) + 1))
            mins = (a / (bb + 1) + 1);
        if (maxs > a / bb)
            maxs = a / bb;
    }
    cout<<mins<<' '<<maxs;
}